package com.ltkj.shop.domain.vo;

import com.ltkj.common.core.utils.bean.BeanUtils;
import com.ltkj.shop.domain.ShopGoodsSpec;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 商品规格页面展示对象 shop_goods_spec
 * 
 * @author xupf
 * @date 2023-08-31
 */
@ApiModel(value = "商品规格")
public class ShopGoodsSpecVo
{
    private static final long serialVersionUID = 1L;

    /** 规格id */
    @ApiModelProperty("规格id")
    private Long id;

    /** 商品id */
    @ApiModelProperty("商品id")
    private Long goodsId;

    /** 规格种类 */
    @ApiModelProperty("规格种类")
    private String type;

    /** 规格名称 */
    @ApiModelProperty("规格名称")
    private String name;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setGoodsId(Long goodsId) 
    {
        this.goodsId = goodsId;
    }

    public Long getGoodsId() 
    {
        return goodsId;
    }
    public void setType(String type) 
    {
        this.type = type;
    }

    public String getType() 
    {
        return type;
    }
    public void setName(String name) 
    {
        this.name = name;
    }

    public String getName() 
    {
        return name;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("goodsId", getGoodsId())
            .append("type", getType())
            .append("name", getName())
            .toString();
    }

    public static ShopGoodsSpecVo fromEntity(ShopGoodsSpec shopGoodsSpec) {
        ShopGoodsSpecVo shopGoodsSpecVo = new ShopGoodsSpecVo();
        BeanUtils.copyBeanProp(shopGoodsSpecVo, shopGoodsSpec);
        return shopGoodsSpecVo;
    }
}
